package com.lanyou.esb.datadictionary;

import java.rmi.NoSuchObjectException;

import org.apache.commons.lang3.StringUtils;

/**
 * 参数类型<br>
 * 描述：<br>
 * 1:请求参数;2:返回参数;<br>
 * 
 * @author Davey.wu
 */
public enum ParameterType {

	REQUEST("1"), RETURN("2");

	// public static final String TypeCode = "10009";

	public final String ValueCode;

	private ParameterType(String code) {
		this.ValueCode = code;
	}

	public static ParameterType get(String valueCode)
			throws NoSuchObjectException {
		if (StringUtils.isEmpty(valueCode)) {
			throw new NullPointerException();
		}
		for (ParameterType type : ParameterType.values()) {
			if (type.ValueCode.equals(valueCode)) {
				return type;
			}
		}
		throw new NoSuchObjectException(valueCode);
	}
}
